1. Field of the Invention
The present invention relates in general to memory devices, and more particularly file systems suitable for use with nonvolatile memories.
2. The Background Art
As is known to those skilled in the art, numerous file system implementations have been developed. Most file systems known in the art have been developed with the assumption that the files would be stored on a magnetic disk or—in the case of data networking implementations—on a magnetic disk attached to a network file server (“NFS”). Typically, files are divided into data blocks, and these blocks are laid out on the disk in which the files are to be stored. The layout of the blocks on the disk is typically optimized for minimizing the access time for file blocks stored on these disks. These file systems are normally very large, and hence very efficient file searching strategies have been developed.
Most file systems known in the art assume that a complex directory structure will be imposed on the files, and hence complex data structures have typically been required to handle them. However, other file systems known to those skilled in the art store files in a contiguous fashion. For example, on some types of nonvolatile memory, such as flash memory media, files are typically stored in a contiguous fashion on the flash card containing the flash memory. In such a flash memory medium, there is typically no concept of “file blocks” involved. As known to those skilled in the art, however, flash media has its own peculiarities. For example, flash media typically must be reformatted to regain lost space.
Nonvolatile (sometimes written as “non-volatile”) random access memory (“nvram,” or “NVRAM”) is typically a form of static RAM whose contents are saved when a computer is turned off or loses its external power source. As is known to those skilled in the art, nvram may be implemented in various ways, including by providing static RAM with backup battery power, or by saving its contents and restoring them from an Electrically Erasable Programmable Read Only Memory (“EEPROM”).
The development of nvram enabled files to be stored in a system in a persistent way. However, existing file systems are inadequate for addressing the unique set of challenges presented by the nvram memory storage media. First and foremost, the nvram media is relatively small in terms of memory capacity (typically ranging from a few hundred kilobytes to a few megabytes). Thus, only a relatively small number of files can be stored on the media. Secondly, nvram can be accessed relatively quickly, in comparison to magnetic disks, and hence disk block layout is not a major factor that affects the seek time parameter. Also, no directory structure is typically imposed on the nvram medium.
Moreover, because critical system data is often stored in nvram (e.g., cryptographic keys, system start-up configuration files, or other types of secure files), an nvram file system must be reliable. Specifically, a system “crash” should not corrupt the file system. In order to deal with these problems, a simple but elegant file system storage for the nvram medium is disclosed herein. It provides all the necessary functionality without being burdened by unnecessary details and restrictions imposed by a traditional file system. The main assumptions of the file system design according to embodiments of the present invention are that (1) the file system structure is flat (i.e., does not contain directories), and (2) a relatively small amount of memory space is available. Also, an important design goal is not to have excessive file system information in the nvram memory medium at any given time. Most of the information is kept on the nvram, and based on this, other information may be obtained. Thus, a system crash will not result in loss of vital information which might have been buffered in memory. These and other features and advantages of the present invention will be presented in more detail in the following specification of the invention and in the associated figures.